import { defineConfig } from 'vite'
import react from '@vitejs/plugin-react'
import tailwindcss from '@tailwindcss/vite'
import path from 'path'


// https://vite.dev/config/
export default defineConfig({
  plugins: [react(), tailwindcss()],
  resolve: {
    alias: {
      '@': path.resolve(__dirname, './src'),
    },
  },
  server: {
    proxy: {
      '/api': {
        target: 'http://localhost:9003',
        changeOrigin: true,
      },
    },
  },
  css: {
    modules: {
      // 配置 CSS modules
      localsConvention: 'camelCase', // 将 CSS 类名转换为驼峰命名
      scopeBehaviour: 'local', // 默认就是 local，可以不写
      generateScopedName: '[local]___[hash:base64:5]', // 生成的类名格式
    }
  }
})
